Total Reuse of Ancestor unitary (TRAu)

Description:

Reuse of Ancestors

The RA Metric

Definition 1 (Reuse of Ancestor-class - RA) The RA metric between a class C and one of its ancestor classes A is formally expressed as:

i = nC
RA(C; A) = RDA(mth i; A)/nC
i = 1

where mthi (i = 1; nC) represent the methods defined in class C.

Explanations The RA metric quantifies the reuse from a super class by totalizing this reuse from all of its methods. The degree to which a method reuses an ancestor class is variable. We consider that the way this reuse degree is calculated depends on the goals of the measurement. Consequently we decided to parameterize the metric with a family of metrics called Reuse Degree of Ancestor-class (RDA), that evaluates this reuse degree. A description of this family of metrics is presented below.

The RDA Metrics

Definition 2 (Reuse Degree of Ancestor-class) A function expressing the measure of reuse of an ancestor class A in method mthi of class C is called Reuse Degree of Ancestor-class A in method mthi .

RDA : SMFC X SACC --> [0; 1]

where SMFC is the set of all member functions (methods) in class C and SAC C is the set of ancestors classes A for class C.

Unitary RDA - RDAunit The Unitary Reuse Degree of Ancestor-class is defined as:

RDAunit(mthC; A)= { 1 if method mthC uses at least one member of class A
0 if method mthC uses no member of class

The Total RA Metric - TRA

As we have seen the RA metric has two parameters: a particular class and one of its ancestor classes. We think that it is necessary to have also a metric that expresses the total reuse (from all the ancestors) for a given class. We will base the definition of this new metric, on the definition of the already defined RA metric.

Definition 3 (Total Reuse from Ancestors - TRA) The Total Reuse from Ancestors metric for a class C is defined as the sum of all RA values between class C and its superclasses. This can be formally expressed as:

i = nA
TRA(C) = RA(C; Ai)
i = 1

where nA represents the number of ancestor-classes for class C, and Ai is the iterator of its ancestor classes.

Source: Ing. Radu Marinescu. An Object Oriented Metrics Suite on Coupling. Universitatea "Politehnica" Timisoara, Facultatea de Automatica si Calculatoare, Departamentul de Calculatoare si Inginerie Software. September, 1998.